package com.twu.biblioteca;

/**
 * Created with IntelliJ IDEA.
 * User: alacerda
 * Date: 10/10/13
 * Time: 11:57 AM
 * To change this template use File | Settings | File Templates.
 */
public class Movie {

    private String title;
    private String director;
    private String year;
    private String rating;

    public Movie(String title, String director, String year, String rating) {
        this.title = title;
        this.director = director;
        this.year = year;
        this.rating = rating;
    }

    public String getRating() {
        return rating;
    }

    public void setRating(String rating) {
        this.rating = rating;
    }

    public String getYear() {
        return year;
    }

    public void setYear(String year) {
        this.year = year;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public String toString() {
        String format = "|%1$-20s|%2$-20s|%3$-5s|%4$-2s\n";
        StringBuilder movie = new StringBuilder();
        movie.append(String.format(format, title, director, year, rating));
        return movie.toString();
    }
}
